import request from '@/utils/request.js'

// 获取评论列表
export const getCommentList = params => {
  return request({
    method: 'GET',
    url: '/v1_0/comments',
    params
  })
}

// 对评论取消点赞
export const setDislike = target => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`
  })
}

// 对评论点赞
export const setLike = id => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target: id
    }
  })
}

// 发布评论
export const publishComment = data => {
  return request({
    method: 'POST',
    url: '/v1_0/comments',
    data
  })
}
